import { request } from '@/utils/request'

// /api/renovation/apply/record/page
// 获取装修申请记录
export const getRenovationApplyRecord = (params: object) => {
  return request({
    url: '/api/renovation/apply/record/page',
    method: 'GET',
    data: params
  })
}
// /api/renovation/apply/record/save
// 保存装修申请记录
export const saveRenovationApplyRecord = (params: object) => {
  return request({
    url: '/api/renovation/apply/record/save',
    method: 'POST',
    data: params
  })
}
// /api/renovation/apply/record/detail
// 获取装修申请记录详情
export const getRenovationApplyRecordDetail = (params: object) => {
  return request({
    url: '/api/renovation/apply/record/detail',
    method: 'GET',
    data: params
  })
}

// /feedback/submit
// 提交反馈
export const submitFeedback = (params: object) => {
  return request({
    url: '/api/feedback/submit',
    method: 'POST',
    data: params
  })
}

// /api/repair/order/save
// 提交维修订单
export const saveRepairOrder = (params: object) => {
  return request({
    url: '/api/repair/order/save',
    method: 'POST',
    data: params
  })
}
// /api/repair/order/page
// 获取维修订单列表
export const getRepairOrderPage = (params: object) => {
  return request({
    url: '/api/repair/order/page',
    method: 'GET',
    data: params
  })
}
// /api/repair/order/detail
// 获取维修订单详情
export const getRepairOrderDetail = (params: object) => {
  return request({
    url: '/api/repair/order/detail',
    method: 'GET',
    data: params
  })
}
// /api/repair/order/payment
// 支付维修订单
export const paymentRepairOrder = (params: object) => {
  return request({
    url: '/api/repair/order/payment',
    method: 'POST',
    data: params
  })
}
// /api/rent/goods/page
// 获取物品借用列表
export const getRentGoodsPage = (params: object) => {
  return request({
    url: '/api/rent/goods/page',
    method: 'GET',
    data: params
  })
}
// /api/borrow/record/page
// 获取物品借用记录
export const getBorrowRecordPage = (params: object) => {
  return request({
    url: '/api/borrow/record/page',
    method: 'GET',
    data: params
  })
}
// /api/borrow/record/applyBorrow
// 申请借用物品
export const applyBorrow = (params: object) => {
  return request({
    url: '/api/borrow/record/applyBorrow',
    method: 'POST',
    data: params
  })
}

// /api/mall/category/page
// 获取商品分类列表
export const getProductCategoryPage = (params: object) => {
  return request({
    url: '/api/mall/category/page',
    method: 'GET',
    data: params
  })
}
// /api/mall/product/page
// 获取商品列表
export const getProductPage = (params: object) => {
  return request({
    url: '/api/mall/product/page',
    method: 'GET',
    data: params
  })
}
// /api/mall/product/detail
// 获取商品详情
export const getProductDetail = (params: object) => {
  return request({
    url: '/api/mall/product/detail',
    method: 'GET',
    data: params
  })
}
// /api/mall/order/page
// 获取订单列表
export const getOrderPage = (params: object) => {
  return request({
    url: '/api/mall/order/page',
    method: 'GET',
    data: params
  })
}
// /api/mall/order/detail
// 获取订单详情
export const getOrderDetail = (params: object) => {
  return request({
    url: '/api/mall/order/detail',
    method: 'GET',
    data: params
  })
}
// /api/mall/order/createOrder
// 创建订单
export const createOrder = (params: object) => {
  return request({
    url: '/api/mall/order/createOrder',
    method: 'POST',
    data: params
  })
}
// /api/mall/order/mallPayment
// 支付订单
export const mallPayment = (params: object) => {
  return request({
    url: '/api/mall/order/mallPayment',
    method: 'POST',
    data: params
  })
}
// /api/mall/order/cancel
// 取消订单
export const cancelOrder = (params: { id: string }) => {
  return request({
    url: `/api/mall/order/cancel?id=${params.id}`,
    method: 'POST'
  })
}

// /api/mall/order/applyRefund
// 申请退款
export const applyRefund = (params: { id: string }) => {
  return request({
    url: `/api/mall/order/applyRefund?id=${params.id}`,
    method: 'POST'
  })
}
